<template>
	<view class="flex flex-column align-center u-p-y-50 bg-white">
		<u-image src="/static/order/suc.png" width="150" height="150"></u-image>
		<text class="u-p-y-20 u-font-40 font-weight-bold">支付成功</text>
		<text class="u-p-y-20 u-font-40 font-weight-bold">¥{{price || '0.00'}}</text>
		<text class="u-m-t-40" v-if="from == 'commom' || from == 'cart'">我们将尽快为您安排发货~</text>
		<text class="u-m-t-40" v-if="from == 'group'">可前往我的拼团查看详情</text>
		<text class="u-m-t-40" v-if="type == 'seckill'">可前往我的秒杀查看详情~</text>
		<view class="flex flex-1 justify-evenly u-p-t-50" style="width: 100%;">
			<dy-button size="medium" borderColor="#333" backgroundColor="#fff" color="#333" @click="toOrder">查看订单</dy-button>
			<dy-button size="medium" @click="toIndex">返回首页</dy-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				from: 'common',
				price: ''
			};
		},
		onLoad(options) {
			console.log('options', options);
			this.from = options.from || 'common'
			this.price = options.price || 0
		},
		methods: {
			toOrder() {
				console.log(this.from);
				let url = ''
				if(this.from == 'common' || this.from == 'cart') url = '/pages/order/mineOrderList/mineOrderList'
				if(this.from == 'group') url = '/pages/group/groupMine/groupMine'
				if(this.from == 'seckill') url = '/pages/seckill/seckillMine/seckillMine'
				uni.redirectTo({
					url: url
				})
			},
			toIndex() {
				uni.switchTab({
					url: '/pages/tabbar/index/index'
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
